edit-message: Show error dialog on edit-message request error #1792
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With #188, the message-list UI for an unsubscribed channel will become more prominent, which calls for fixing at least the following glitch:
Since we don't get events when the self-user sends or edits a message in an unsubscribed channel, we'd like to refetch messages on success of those actions. Discussion: #mobile > Message sending in unsubscribed channels @ 💬 So, on the path to that, make
store.editMessage
similar tostore.sendMessage
in returningFuture<void>
instead ofvoid
, where the returned Future resolves or rejects with the API request, irrespective of the event.While we're at it, show an error dialog when the edit fails, as we've been meaning to do, again for consistency with the send-message UX.
Compare error feedback on sending an invalid message (in
main
and unchanged here) vs. trying to save an invalid message edit (new here; inmain
we show no dialog):The outbox logic is unchanged. As in
main
, we show "MESSAGE NOT SENT" and "EDIT NOT SAVED" in the message list, and these are tappable to restore the composing session and try again.